version: '3.3'
services:
  mongo-db:
   image: mongo:4.4-focal
   container_name: mongo-db
   restart: always
   ports:
     - '27017:27017'
   volumes:
     - mongo_value:/data/db
   networks:
     - parolus_network

  fastapi-backend:
    build:
      context: ./backend/
      dockerfile: Dockerfile
    container_name: fastapi-backend
    restart: always
    networks:
      - parolus_network

  nginxvuejs-webserver:
    build:
      context: ./frontend/
      dockerfile: Dockerfile
    container_name: nginxvuejs-webserver
    restart: always
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
      - ./backend/localhost.crt:/etc/nginx/certs/localhost.crt
      - ./backend/localhost.key:/etc/nginx/certs/localhost.key
    networks:
      - parolus_network

networks:
      parolus_network:
          driver: bridge

volumes:
  mongo_value:
